<template>
	<view class="content">
		<view class="content-title">
			<image src="https://img.redocn.com/sheji/20180422/chuidiaodiaoyubisaihuodongxuanchuanhaibao_9363227.jpg"
				mode=""></image>
		</view>

		<view class="time" @click="gologin">
			{{ timmer }} &nbsp;跳过

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				timmer: 5
			}
		},
		mounted() {
			setInterval(() => {
				if (this.timmer > 1) {
					this.timmer--
				} else {
					this.timmer = 0
				}
			}, 1000)
			setTimeout(() => {

				uni.switchTab({
					url: '/pages/tabbar/tabbar-1/tabbar-1'
				})
			}, 5000);
		},
		methods: {
			gologin() {
				uni.switchTab({
					url: '/pages/tabbar/tabbar-1/tabbar-1'
				})
			}
		},
		deactivated() {
			clearInterval(this.timmer)
		}
	}
</script>

<style lang="scss">
	.content {
		width: 100%;
		height: 100vh;

		.content-title {
			image {
				width: 100%;
				height: 100vh;
			}
		}

		.time {
			color: white;
			font-weight: bold;
			z-index: 99;
			position: fixed;
			top: 10rpx;
			right: 20rpx;
		}
	}
</style>